using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DynConDevCorp.OpenArch.SmartData.Interfaces.EventArgClasses;

namespace DynConDevCorp.OpenArch.SmartData.Interfaces
{
    [Flags]
    public enum EffectCauses
    {
        ValueChanged = 0x00001,
        DisplayValueChanged = 0x00002,
        MetaDataChanged = 0x00004,

        FieldValueChanged = 0x00100,
        FieldDisplayValueChanged = 0x00200,
        FieldMetaDataChanged = 0x04000,

        CollectionItemValueChanged = 0x001000,
        CollectionItemDisplayValueChanged = 0x002000,
        CollectionItemMetaDataChanged = 0x04000,
        CollectionContentChanged = 0x07000,

    }
    /// <summary>
    /// Base Interface for all Effect classes which are not dependant on the Type of data involved in the 
    /// process
    /// </summary>
    /// <remarks>
    /// While the SmartData architecture does support the normal Event based approach, the usage of Effects provided
    /// a much greater degree of control. Most Even implementations are wrappers that create (or destroy) Effect instances
    /// internally, and as such do NOT provide any benefits other than a more a familiar syntax.
    /// </remarks>
    public interface ISmartEffect
    {
        EffectCauses TriggerableCauses { get;}
        void Execute(EffectCauses cause);
    }

    /// <summary>
    /// Generic Base Interface for all Effect classes which are dependant on the Type of data involved in the 
    /// process
    /// </summary>
    /// <remarks>
    /// While the SmartData architecture does support the normal Event based approach, the usage of Effects provided
    /// a much greater degree of control. Most Even implementations are wrappers that create (or destroy) Effect instances
    /// internally, and as such do NOT provide any benefits other than a more a familiar syntax.
    /// </remarks>
    /// <typeparam name="TData">The type of the AT a_ TYPE.</typeparam>
    public interface ISmartEffect<TData> : ISmartEffect
    {
        /// <summary>
        /// Fires the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        void InvokeEffect(Object sender, ValueChangedEventArgs<TData> args);
    }
}
